Uec3.SaleReturnEditWin = Ext.extend(Ext.UecWindow,{	
	
	fieldsName:['partnerIdBySeller','gmtRealDelivery','memoOfSeller'],
	
	constructor : function(config){
		
		this.params = config.params||{},
		
		this.partnerLookup = getPartnerLookup(0,{app:this.params.app,grid:[2,1,2,1]});
		
		this.partSourceComb = Uec3.App.dictionary.getCombo("part_source",{hiddenName:'source'});
		
		this.storeComb = getPartStoreComb4Grid();
		
		this.deleteItemIds = [];
		
		this.northPanel = new Ext.FormPanel({
			frame : true,
			region : 'north',
			height:90,
			width:'100%',
			items:[
				{
					layout:'uec3grid',
					layoutConfig:{
						hGrid:[6,17,54,6,17],
						vGrid:[55,45]
					},
					height:45,
					items:[
						{xtype:'label',text:'销售退货单',style: {textAlign : 'center',font:'bold 20px arial,serif'},grid:[3,1,3,1]},
						{xtype:'label',text : '单据号:',grid:[4,1,4,1]},
						{
							xtype : 'textfield',																				  
					      	name : 'codeOfSeller',							 
					     	readOnly :true,
					      	style:{background:'#dddddd'},
					      	grid:[5,1,5,1]
				         },{
				         	html:'<hr color="#34A4E0" />',
							grid:[1,2,5,2]
				         }
					]
				},{
					layout:'uec3grid',
					layoutConfig:{
						hGrid:[4,32,6,15,4,39],
						vGrid:[100]
					},
					height:45,
					items:[
						{xtype:'label',text:'客户:',grid:[1,1,1,1]},this.partnerLookup,
						{xtype:'label',text:'退货日期:',style:{marginLeft:'3px'},grid:[3,1,3,1]},
						{xtype :'datefield',name : 'gmtRealDelivery',format:'Y-m-d H:i:s',grid:[4,1,4,1]},
						{xtype:'label',text:'备注:',style:{marginLeft:'3px'},grid:[5,1,5,1]},
						{xtype :'textfield',name : 'memoOfSeller',autoScroll:true,grid:[6,1,6,1]},
						{xtype :'hidden',name:'status'},
						{xtype :'hidden',name:'id'},
						{xtype :'hidden',name:'buyerId'}  	
					]
				}
			]
		});		
		
		var saleReturnItems_store = new Ext.data.JsonStore({
			root:'',
        	pruneModifiedRecords:true,
       		fields:[  
				{name:'id'},
				{name:'saleReturnId'},        //-- 销售退货ID
				{name:'partId'},
				{name:'sourceInventoryId'},  //---来源零件库存ID(指定了从哪个库存上退货)
				{name:'code'},
				{name:'source'},
				{name:'name'},
				{name:'caModel'},
				{name:'nameEn'},
				{name:'pyCode'},
				{name:'measurementUnit'},
				{name:'partCategoryId'},
				{name:'level1Name'},
				{name:'level2Name'},
				{name:'level1Id'},
				{name:'brand'},
				{name:'origin'},
				{name:'cost'},
				{name:'retailPrice'},      //-- 售价
				{name:'saleQuantity'},    //-- 销售数量(saleItem的QUANTITY字段)
				{name:'quantity'},         //-- 实际退货数量
				{name:'retailAmount'},     //-- 销售金额
				{name:'storeId'},
				{name:'storeName'},
				{name:'shelf'}               	                     	      
      	    ]
		});
		
		var gridColumn = new Ext.grid.ColumnModel({
			columns:[
				new Ext.grid.RowNumberer(),
				{header:'零件编码',dataIndex:'code'},
                {header:'零件名称',dataIndex:'name'},
            	{header:'车型',dataIndex:'carModel'},
            	{header:'来源',dataIndex:'source',renderer:Ext.util.Format.comboRenderer(this.partSourceComb)},
            	{header:'单位',dataIndex:'measurementUnit'},
            	{header:'销售数量',dataIndex:'saleQuantity'},
            	{header:'退货数量',dataIndex:'quantity',
				      editor:new Ext.form.NumberField({
        					 allowBlank: false,
         					 allowNegative: false
    			      })	             			 
			 	},
			 	{header:'销售价',dataIndex:'retailPrice'},
			 	{header:'退货金额',dataIndex:'retailAmount'},
            	{header:'品牌',dataIndex:'brand'},
            	{header:'产地',dataIndex:'origin'},
            	{header:'仓库',dataIndex:'storeName',editor:this.storeComb},
            	{header:'仓位',dataIndex:'shelf',editor : new Ext.form.TextField()}
			],
			defaults: {
          		//sortable: true,
          		menuDisabled: true,
          		width:120
       		}
		});
		
		this.toolBar = new Ext.Toolbar({			
			items:[
				{text : '新增明细',iconCls : 'icon-add',handler:this.showAddSaleReturnItemForm,scope:this},
				{text : '删除明细',iconCls : 'icon-del',handler:this.deleteSaleReturnItem,scope:this}]
		});
		
		this.centerPanel = new Ext.grid.EditorGridPanel({
			frame : false,
			columnLines :true,
			region : 'center',
			enableHdMenu : false,
			stripeRows: true,
			store:saleReturnItems_store,   
			viewConfig:
			{
			  scrollOffset:15
			},
			clicksToEdit:1,
			autoScroll: true,
			tbar : this.toolBar,
			colModel:gridColumn,			
			selModel:new Ext.grid.RowSelectionModel({moveEditorOnEnter:true,singleSelect :true})			
		});
		
		this.southPanel = new Ext.FormPanel({
			labelAlign:'left',
			region :'south',
			height:65,
			frame:true,
			items:[
				{
					layout:'uec3grid',
					layoutConfig:{
						hGrid:[6,7,5,7,6,7,5,7,6,7,5,7,6,7,5,7],
						vGrid:[100]					  	
					},
					height:26,
					defaultType:'textfield',
					items:[
						{xtype:'label',text:'订单状态:',grid : [1, 1, 1, 1]},
						{name:'statusName',readOnly:true,style:{background:'#dddddd'},grid : [2,1,2,1]},
						{xtype:'label',text:'创建人:',grid : [3, 1, 3, 1]},
						{name:'creatorName',readOnly:true,style:{background:'#dddddd'},grid : [4,1,4,1]},
						{xtype:'label',text:'创建时间:',grid : [5, 1, 5, 1]},
						{name:'gmtCreate',readOnly:true,style:{background:'#dddddd'},grid : [6,1,6,1]},
						{xtype:'label',text:'提交人:',grid : [7, 1, 7, 1]},
						{name:'submitterName',readOnly:true,style:{background:'#dddddd'},grid : [8,1,8,1]},
						{xtype:'label',text:'提交时间:',grid : [9, 1, 9, 1]},
						{name:'gmtSubmit',readOnly:true,style:{background:'#dddddd'},grid : [10,1,10,1]},
						{xtype:'label',text:'审核人:',grid : [11, 1, 11, 1]},
						{name:'deliveryerName',readOnly:true,style:{background:'#dddddd'},grid : [12,1,12,1]},
						{xtype:'label',text:'审核时间:',	grid : [13, 1, 13, 1]},
						{name:'gmtDelivery',readOnly:true,style:{background:'#dddddd'},grid : [14,1,14,1]},
						{xtype:'label',text:'总金额:',grid : [15, 1, 15, 1]},
						{name:'amount',readOnly:true,style:{background:'#dddddd'},grid : [16,1,16,1]}
					]				
				}]		
		});
		
		config = Ext.apply(config||{},{items:[this.northPanel,this.centerPanel,this.southPanel]});
		
		Uec3.SaleReturnEditWin.superclass.constructor.call(this,config);
	},
	
	 //private
	initComponent:function(){
		Uec3.SaleReturnEditWin.superclass.initComponent.call(this);
	},
	
	initEvents : function(){
		var module = this;
		Uec3.SaleReturnEditWin.superclass.initEvents.call(this);	
		this.partSourceComb.getStore().load();
		this.on('show',this.winAfterShow,this);
		this.partnerLookup.on('select',module.selectPartnerComb,module);
		this.partnerLookup.on('lookupChange',module.lookupChangePartnerComb,module);
		this.partnerLookup.on('lookupClear',module.resetWholeRecord,module);
	},
	
	selectPartnerComb : function(lookup,record,index){
		if(lookup.getValue() && (lookup.getValue() + '').trim() != '' && lookup.getValue() != record.data.id ) {
			Ext.MessageBox.confirm("提示", '确定更改客户?',function(btnId){
				if(btnId == "no"){
					return;
				}else{
					//lookup.initializeValue({'name':record.data.name,'pyCode':record.data.pyCode,'id':record.data.id});
					lookup.setValue(record.data[lookup.valueField], record.data[lookup.lookupField]);					
					this.northPanel.getForm().findField("buyerId").setValue(record.data.companyId);
				}
			},this);
		}else if(!lookup.getValue()){
			lookup.setValue(record.data[lookup.valueField], record.data[lookup.lookupField]);
			this.northPanel.getForm().findField("buyerId").setValue(record.data.companyId);
		}
	},
	
	lookupChangePartnerComb : function(record, creator, oldValue, win){
		if(oldValue && (oldValue + '').trim() != '' && record.data.id != oldValue ){
			Ext.MessageBox.confirm("提示", '确定更改客户?',function(btnId){
				if(btnId == "no"){
					return;
				}else{					
					creator.setLookupValue(record.data, win);
					this.northPanel.getForm().findField("buyerId").setValue(record.data.companyId);
				}
			},this);
		}else if(!oldValue){
			creator.setLookupValue(record.data, win);
			this.northPanel.getForm().findField("buyerId").setValue(record.data.companyId);
		}
	},
	
	resetWholeRecord : function(){
		Ext.MessageBox.confirm("提示","确定删除该客户?",function(btnId){
			if(btnId == 'yes'){
				this.clearAllTabel();
			}				
		},this);	
	},
	
	getSelectedItem : function(){
		var record= this.centerPanel.getSelectionModel().getSelected();	   
	     if(record == null){
	         Ext.MessageBox.alert('提示','请选择要删除的退货明细！');
	         return;
	     }else{
	        return record;
	     }
	},
	
	deleteSaleReturnItem : function(){
		var record = this.getSelectedItem();
		var id =record.get('id');
		Ext.Msg.confirm("提示","确定删除所选记录",function(btnId){    
			if(btnId=="yes"){
				if(id){
					//将删除的记录的id放入数组中	     	    
					this.deleteItemIds.push(id);
				}	                      
				this.centerPanel.getStore().remove(record);
				this.centerPanel.getView().refresh();
			}
		});
	},
	
	showAddSaleReturnItemForm:function(){
		var module = this;
		var partnerId = this.partnerLookup.getValue();
		if(Ext.isEmpty(partnerId)){
			Ext.MessageBox.alert("提示","请先填写客户信息");
		}else{
			redirectUrl("saleReturnItemAdd",{partnerComb : this.partnerLookup,saleReturnItemRecords : this.centerPanel.getStore().getRange(),
						fn:function(record){
						    var saleReturnItem_store = module.centerPanel.getStore();					   		
							if(record.get('isAdd')){
								var index = saleReturnItem_store.findExact("sourceInventoryId",record.get('sourceInventoryId'));
								if(index != -1){
						    		var oldRecord = saleReturnItem_store.getAt(index);
						    		oldRecord.set('quantity',record.get('quantity'));
			   						saleReturnItem_store.commitChanges(); 
						    	}else{
									saleReturnItem_store.add(record);
								}								
							}else{
								saleReturnItem_store.remove(record);
							}
									
						}
			});
		}		
	},
	
	operation : function(btn){
		eval("this."+btn.func+"(btn)");
	},
	
	initButtons : function(){
		var myMask = new Ext.LoadMask(this.el,{msg : "按钮加载中,请稍候...."});
        myMask.show();
        Ext.Ajax.request({
			url:Uec3.App.Constants.homeUrl+"/saleReturn/toSaleReturn!getInitialButtons.do",
			callback :function(options,success,response){
			     myMask.hide();    
			},
			success: function(response,options){
				var resp =Ext.decode(response.responseText);
				var buttons = resp.buttons;					 	
				//显示相应按钮条
				fillButtons(buttons,this.operation.createDelegate(this),this.southPanel);
			},
			failure: function(response,options){
				Ext.MessageBox.alert("提示","网络异常,初始化按钮出错!");
			},
			scope: this
		});
	},
	
	initSaleReturnAndItemById : function(saleReturnId){
		var myMask = new Ext.LoadMask(this.el,{msg : "销售退货单加载中,请稍候...."});
        myMask.show();
        Ext.Ajax.request({
   			url:Uec3.App.Constants.homeUrl+"/saleReturn/toSaleReturn!getSaleReturnAndItemById.do",
   			params: {queryParam:saleReturnId},
   			callback :function(options,success,response){
       			myMask.hide();
    		},
   			success: function(response,options){
      			 var resp =Ext.decode(response.responseText);
       			 if(resp.success){
    	  			this.fillMainContent(resp);
    	   			//改变窗口的title
    	  			changeWindowUecId(resp.main.codeOfSeller,this.params.uecId);  				
      			 }else{
    	   			Ext.MessageBox.alert("提示",resp.msg);
      			 }
   			},
  			failure: function(response,options){
      			 Ext.MessageBox.alert("提示","网络异常,加载数据错误!");
  			},
   			scope: this
       });
	},
	
	clearAllTabel : function(){
		var myMask = new Ext.LoadMask(this.el,{msg : "处理中,请稍后...."});
    	myMask.show();
    	this.northPanel.getForm().reset();
    	this.partnerLookup.clearValue();
    	this.centerPanel.getStore().removeAll();
		this.southPanel.getForm().reset();
    	myMask.hide();
	},
	
	/**
	 * 保存草稿
	 */
	backupDraft:function(btn){
		this.saveSaleReturnAndItems(btn,'确定保存草稿?','草稿保存中,请稍后.......');
	},
	/**
	 * 提交仓库
	 */
	backupSubmit:function(btn){
		this.saveSaleReturnAndItems(btn,'确定保存单据为待仓库审核状态?','待审核单据保存中,请稍后.......');
	},
	  
	/**
	 * 直接退库
	 */
	delivery:function(btn){
		this.saveSaleReturnAndItems(btn,"确定退货?","正在退货中,请稍后.....");
	},
	
	/**
	 * 重置表单
	 */
	reset:function(){
		Ext.MessageBox.confirm("提示","确定清空表单?",function(btnId){
			if(btnId == 'yes'){
				this.clearAllTabel();
			}				
		},this);
	},
	
	/**
	 * 跳转浏览浏览销售退货单页面
	 */
	saleReturnBrowser:function(btn){
		redirectUrl("saleReturn_browser");
	},
	/**
	 * 跳转新建销售退货单
	 */
	newSaleReturn:function(btn){
		redirectUrl("saleReturn_edit");
	},
	/**
	 * 打印单据
	 */
	printSaleReturn:function(){
		alert("to be continued.....");
	},
	/**
	 * 退出
	 */
	exit:function(btn){
		Ext.MessageBox.confirm("提示","确定退出?",function(btnId){
			if(btnId == 'yes'){
				this.close();
			}				
		},this);	
	},
	/**
	 * 接手单据
	 */
	acceptSaleReturn:function(btn){
		this.acceptOrReleaseSaleReturn(btn,'确定接手单据?','正在接手单据,请稍后......');
	},
	/**
	 * 释放单据
	 */
	releaseSaleReturn:function(btn){
		this.acceptOrReleaseSaleReturn(btn,"确定释放单据?","正在释放单据,请稍后.....");
	},

	 /**
	  *根据Id删除退库单 
	  */ 
	deleteCreate:function(btn){
		var saleReturnId = this.northPanel.getForm().findField("id").getValue();
		if(!Ext.isEmpty(saleReturnId)){
			Ext.MessageBox.confirm("提示",msg,function(btnId){
				if(btnId=='yes'){
					var myMask = new Ext.LoadMask(this.el,{msg : "销售退货单草稿删除中,请稍后...."});
					myMask.show();
					Ext.Ajax.request({
            			url:btn.url,
            			params :{queryParam:saleReturnId},
            			method :"post",
            			timeout:180000,
            			callback :function(options,success,response){
            	        	myMask.hide();
            			},
            			success:function(response,options){
            				var resp = Ext.decode(response.responseText);
            				Ext.MessageBox.alert("提示",resp.msg); 
            				if(resp.success){
            	             	this.close();
            					redirectUrl("saleReturn_browser");            		
            				}           				   			           				              
            		    },
           				failure:function(response,options){
               				Ext.MessageBox.alert("提示","发生异常，请稍候处理!");    
            			},
						scope:this
					});
				}
			},this);
		}   
	},
	/**
	 * 处于待仓库点数状态下的退库单退回草稿
	 */
	backToCreate:function(btn){
		var saleReturnId = this.northPanel.getForm().findField("id").getValue();
		if(!Ext.isEmpty(saleReturnId)){
			Ext.MessageBox.confirm("提示",msg,function(btnId){
				if(btnId=='yes'){
					var myMask = new Ext.LoadMask(this.el,{msg : "销售退货单退回草稿中,请稍后...."});
					myMask.show();
					Ext.Ajax.request({
            			url:btn.url,
            			params :{queryParam:saleReturnId},
            			method :"post",
            			callback :function(options,success,response){
            	        	myMask.hide();
            			},
            			success:function(response,options){
            				var resp = Ext.decode(response.responseText);
            				Ext.MessageBox.alert("提示",resp.msg); 
            				if(resp.success){
            	               this.fillMainContent(resp);          		
            				}           				   			           				              
            		    },
           				failure:function(response,options){
               				Ext.MessageBox.alert("提示","发生异常，请稍候处理!");    
            			},
            			scope:this
         			});					 		
				}
			},this);
		}
	},
	
	acceptOrReleaseSaleReturn : function(btn,msg,wait){
		var saleReturnId = this.northPanel.getForm().findField("id").getValue();
		if(!Ext.isEmpty(saleReturnId)){
			Ext.MessageBox.confirm("提示",msg,function(btnId){
				if(btnId=='yes'){
					var myMask = new Ext.LoadMask(this.el,{msg : wait});
					myMask.show();
					Ext.Ajax.request({
						url:btn.url,
						params :{queryParam:saleReturnId},
						method :"post",
						timeout:180000,
						callback :function(options,success,response){
							myMask.hide();
						},
						success:function(response,options){
							var resp = Ext.decode(response.responseText);
							if(resp.success){
								var buttons = resp.buttons;
								var isOwner = resp.isOwner;			    				
								// 显示相应按钮条
								fillButtons(buttons,this.operation.createDelegate(this),this.southPanel);
								this.rendererSpecificColumnByConditon(isOwner);	                    
							}else{
								Ext.MessageBox.alert("提示",resp.msg);
							}
						},
						failure:function(response,options){
							Ext.MessageBox.alert("提示","网络连接异常，请稍候处理!"); 
						},
						scope:this
					});
				}
			},this);
		}
	},
	/**
	 * 取得主表，明细表数据
	 */
	getSaleReturnAndItems : function(){
		var records = this.centerPanel.getStore().getRange();
		var totalItems = [];
		for(var i = 0;i < records.length; i++){
			var data = records[i].data;
			delete data.isSelected;
			delete data.isAdd;
			totalItems.push(records[i].data);
		}
		var mainData = this.northPanel.getForm().getValues();
		if(Ext.isEmpty(mainData.partnerIdBySeller)){
			Ext.MessageBox.alert("提示","请选择客户");
			return;
		}
		if(Ext.isEmpty(totalItems)){
			Ext.MessageBox.alert('提示','未有退货明细!');
			return;
		}
		var saleReturn = {main:mainData,details:totalItems,deleteItemIds:this.deleteItemIds};
		var saleReturnObj = Ext.encode(saleReturn);
		return saleReturnObj;
	},
	
	saveSaleReturnAndItems:function(btn,msg,wait){
		var saleReturnAndItems = this.getSaleReturnAndItems();
		if(!Ext.isEmpty(saleReturnAndItems)){
			Ext.MessageBox.confirm("提示",msg,function(btnId){
				if(btnId == 'yes'){
					var myMask = new Ext.LoadMask(this.el,{msg:wait});
					myMask.show();
					Ext.Ajax.request({
						url:btn.url,
						method :"POST",					   
						params:{queryParam:saleReturnAndItems},
						timeout:180000,
						callback :function(options,success,response){
							myMask.hide();
						},
						success:function(response,options){
							var resp = Ext.decode(response.responseText);
							if(resp.success){				        
								this.fillMainContent(resp);							
								changeWindowUecId(resp.main.codeOfSeller,"saleReturn_edit","saleReturn_edit"+resp.main.id);
							}else{
								Ext.MessageBox.alert("提示",resp.msg);
							} 	
						},
						failure:function(response,options){
							Ext.Msg.alert('提示','发生异常,请稍候处理');
						},
						scope:this
					});
				}
			},this);		
		}		
	},
	
	fillMainContent : function(response){
		// 主表
		var main_data = response.main;
		// 明细表
		var details_data = response.details;
		// 返回信息
		var msg = response.msg;
		if(!Ext.isEmpty(msg)){
		   msg = Ext.decode(msg);
		}
		// 按钮
		var buttons = response.buttons.buttons;
		// 是否单据所有者
		var isOwner = response.buttons.isOwner;
		 // 主表显示
		this.northPanel.getForm().setValues(main_data);	
		this.partnerLookup.initializeValue({'name':main_data.partnerNameBySeller,'pyCode':main_data.partnerPyCodeBySeller,'id':main_data.partnerIdBySeller});	  	 
		// 明细表显示
		this.centerPanel.getStore().loadData(details_data);
		//状态面板
		this.southPanel.getForm().setValues(main_data);
		// 显示相应按钮条
		fillButtons(buttons,this.operation.createDelegate(this),this.southPanel);		  	  
		//判断是否所有者打开当前单据,页面不同展示效果
		this.rendererSpecificColumnByConditon(isOwner);
		// 显示提示信息
		if(msg.confirm){
			this.toSaleInvoice(msg.confirm,response.receivableId,response.customerId);		  	   		
		}else if(msg.alert){
			Ext.MessageBox.alert("提示",msg.alert);
		}
	},
	
	setReadonlySpecificField : function(){
		Ext.each(this.fieldsName,function(fieldName,index){
			var field = this.northPanel.getForm().findField(fieldName);
			field.setReadOnly(true);
			field.getEl().setStyle('background','#dddddd');
		},this);
	},
	
	cancelReadOnlySpecificField : function(){
		Ext.each(this.fieldsName,function(fieldName,index){
			var field = this.northPanel.getForm().findField(fieldName);
			field.setReadOnly(false);
			field.getEl().setStyle('background','');
		},this);
	},
	
	rendererSpecificColumnByConditon:function(isOwner){
		var status =  this.northPanel.getForm().findField("status").getValue();	
		var gridMask =new Ext.LoadMaskJUPIT(this.centerPanel.getView().mainBody);
		if(isOwner){
			if(status == 1){
				this.setReadonlySpecificField();
				gridMask.hide();
				this.toolBar.disable();
			}else if(status == 2){
				this.setReadonlySpecificField();
				gridMask.show();
				this.toolBar.disable();
			}else{
				this.cancelReadOnlySpecificField();
				gridMask.hide();
				this.toolBar.enable();
			}
		}else{
			this.setReadonlySpecificField();
			gridMask.show();
			this.toolBar.disable();
		}		
	},
	
	toSaleInvoice : function(msg,receivableId,customerId){
		
		Ext.MessageBox.confirm("提示",msg,function(btnId){
			if(btnId == 'yes'){		  	       
				//跳转收款单页面		  	  	  
				Uec3.App.getDesktop().launchWindowByParam("saleInvoice_operation",{id:receivableId,customerId:customerId,winId:receivableId});
			}
		});
	},
	
	winAfterShow : function(){
		if(this.params && this.params.id){
        	this.initSaleReturnAndItemById(this.params.id);
		}else{
        	this.initButtons();
        }
	}
});

Uec3.SaleReturnEditWindow = Ext.extend(Ext.app.Module, {
	id : 'saleReturn_edit',
	/**
	 * Create this modules window here.
	 */
	createWindow : function(params) {
		var windowId = 'saleReturn_edit';
		if (params) {
			windowId += Ext.isEmpty(params.winId) ? "" : "_"+ params.winId;
		}
		params.uecId=windowId;
		params.app = this.app;
		var desktop = this.app.getDesktop();
		var win = desktop.getWindowByUecId(windowId);
		if (!win) {
			win = desktop.createWindow({
				uecId : windowId,
				title : '销售退货',
				params : params,
				width : 1000,
				height : 500,
				minWidth : 1000,
				minHeight : 500,
				iconCls : 'acc-icon',
				shim : false,
				animCollapse : false,
				constrainHeader : true,
				maximizable : true,
				taskbuttonTooltip : "销售退货",
				layout: "border"
			},Uec3.SaleReturnEditWin);
		}else{
			win.params = params;
		}
		win.show();
	}
});